home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 3: CDPD 3
/
Almathera Ten on Ten - Disc 3: CDPD3.iso
/
fish
/
001-100
/
001-025
/
020
/
hd
/
poster
< prev
next >
Wrap
Text File
|
1995-03-17
|
2KB
|
57 lines
Article 763 of net.sources:
Relay-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site unisoft.UUCP
Posting-Version: version B 2.10.3 5.1sysV68-beta 6/6/85; site necis.UUCP
Path: unisoft!lll-lcc!vecpyr!amd!amdcad!decwrl!decvax!wanginst!vaxine!encore!necis!yde
From: yde@necis.UUCP (David Elins ext. 220)
Newsgroups: net.sources
Subject: hd (hex dump, modelled on od)
Message-ID: <281@necis.UUCP>
Date: 8 Apr 86 23:05:50 GMT
Date-Received: 12 Apr 86 16:18:13 GMT
Reply-To: yde@necis.UUCP (David Elins ext. 220)
Organization: NEC Information Systems
Lines: 360
I decided to post this after following the spirited discussion of
the "byte order problem" in net.lang.c.
Everyone has their own favorite version of a hex dump utility. I wrote
this one some time ago and recently modified based on some ideas
stated by Mike Higgins in Computer Language magazine, April 1 1986.
The amended version format the dump based on the natural byte ordering
of the machine on which it runs
for 'little-endian' machines such as the vax the format is
hex_longword hex_longword hex_longword hex_longword offset_in_file |ascii|
.
.
.
with the addresses of hex_longwords increasing right to left (and top
to bottom)
for 'big-endian' machines such as the M68000 the format is
offset_in_file hex_longword hex_longword hex_longword hex_longword |ascii|
.
.
.
with the addresses of hex_longwords increasing left to right
in both cases, the |ascii| portion addresses increase left to right
Usage:
hd [-cx]
The -c option will print the ascii value of each byte above its hex
representation, just like od does.
The -x option reverses the 'natural' byte order of the display.
I have used this program only on Unix system III, system V, and
MS-DOS (Microsoft C, v3.0). I don't know if it will work on Berkeley.
----------- cut here, if you please ---------